/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * SimuladorOnibus.java
 *
 * Created on 03/12/2010, 19:32:43
 */

package sismol.simulador;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.Calendar;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
import javax.persistence.EntityManager;
import javax.persistence.Persistence;
import sismol.cartography.Linha;
import sismol.cartography.Ponto;
import sismol.cartography.Trecho;
import sismol.cartography.TrechoAtual;
import sismol.data.GerenciadorBusca;
import sismol.data.GerenciadorEstimativa;
import sismol.data.GerenciadorFactory;

/**
 *
 * @author koji
 */
public class SimuladorOnibus extends javax.swing.JFrame {

    private static final String URL = "http://localhost:8080/sismol/Embarcado.action";

    private GerenciadorBusca busca = GerenciadorFactory.getGerenciadorBusca();
    private GerenciadorEstimativa estimativa = GerenciadorFactory.getGerenciadorEstimativa();
    private EntityManager em = Persistence.createEntityManagerFactory("sismolPU").createEntityManager();

    private Map<String, Linha> linhas = new HashMap<String, Linha>();
    
    private String[] nomeLinhas;

    private Linha linhaEmSimulacao;
    private Trecho trecho;
    private Long andou = 0L;
    private int timerTime;

    private Long steps;
    private Long tempoReal;
    private Long tempoEstimado;

    private Long onibusId;

    /** Creates new form SimuladorOnibus */
    public SimuladorOnibus() {
        List<Linha> list = busca.listarLinhas();
        nomeLinhas = new String[list.size()];
        int i = 0;
        for (Linha linha : list) {
            linhas.put(linha.getNome(), linha);
            nomeLinhas[i] = linha.getNome();
            i++;
        }

        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();
        jButton1 = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        jPanel2 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jProgressBar1 = new javax.swing.JProgressBar();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jTextField2 = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextPane1 = new javax.swing.JTextPane();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jSpinner1 = new javax.swing.JSpinner();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Seleção de Linha"));

        jLabel1.setText("Linha de Ônibus");

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(nomeLinhas));

        jButton1.setText("Simular");
        jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton1MouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 428, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBox1, 0, 348, Short.MAX_VALUE))
                    .addComponent(jButton1))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton1)
                .addContainerGap())
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Ônibus"));
        jPanel2.setVisible(false);

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Trecho Atual"));

        jLabel2.setText("ponto");

        jLabel3.setText("jLabel3");

        jLabel4.setText("Latitude");

        jTextField1.setText("jTextField1");

        jTextField2.setText("jTextField1");

        jLabel5.setText("Longitude");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jProgressBar1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 408, Short.MAX_VALUE)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel2)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 346, Short.MAX_VALUE)
                                .addComponent(jLabel3))))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(87, 87, 87)
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Controle"));

        jLabel6.setText("Envio de sinal em");

        jScrollPane1.setViewportView(jTextPane1);

        jLabel7.setText("segundos");

        jLabel8.setText("Velocidade:");

        jLabel9.setText("km/h");

        jLabel10.setText("jLabel10");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSpinner1)))
                .addGap(4, 4, 4)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel7)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addGap(51, 51, 51)
                        .addComponent(jLabel10)))
                .addContainerGap(180, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel7)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6))
                .addGap(18, 18, 18)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9)
                    .addComponent(jLabel10))
                .addContainerGap(12, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
        this.jPanel2.setVisible(true);

        linhaEmSimulacao = linhas.get(this.jComboBox1.getSelectedItem().toString());
        Collection<TrechoAtual> trechos = busca.buscaPosicaoDosOnibusDaLinha(linhaEmSimulacao.getId());
        TrechoAtual trechoAtual = trechos.iterator().next();

        this.onibusId = trechoAtual.getOnibus().getId();
        trecho = trechoAtual.getTrecho();

        this.jTextField1.setText(trechoAtual.getLatitude().toString());
        this.jTextField2.setText(trechoAtual.getLongitude().toString());

        this.jLabel2.setText(trecho.getPontoA().getNome());
        this.jLabel3.setText(trecho.getPontoB().getNome());

        Long distancia = trecho.getDistancia();
        Long percorrida = trechoAtual.getDistanciaPercorrida();
        Long porc = Math.round(percorrida.doubleValue() / distancia.doubleValue());

        this.jProgressBar1.setValue(porc.intValue());

        this.jTextPane1.setText("10");
        this.jSpinner1.setValue(40);

        this.timerTime = 10;
        this.steps = 0L;
        TimerTask tt = new TimerTask() {
                @Override
                public void run() {
                    Integer time = SimuladorOnibus.this.timerTime;
                    time = time - 1;

                    if (time == 0) {
                        time = 10;
                        SimuladorOnibus.this.step();
                    }
                    
                    SimuladorOnibus.this.jTextPane1.setText(time.toString());
                    SimuladorOnibus.this.timerTime = time;
                }
        };

        Timer timer = new Timer();
        timer.schedule(tt, 0, 1000);
    }//GEN-LAST:event_jButton1MouseClicked

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new SimuladorOnibus().setVisible(true);
            }
        });
    }

    public void step() {
        Double velocidade = ((Integer) this.jSpinner1.getValue()).doubleValue();
        velocidade = velocidade * 0.277777778;
        velocidade = (Math.sqrt(-2*Math.log(Math.random()) )*Math.cos( 2*Math.PI*Math.random())) + velocidade;

        Double lat = 0d;
        Double lng = 0d;

        System.out.println("Velocidade: " + velocidade);
        Long metros = velocidade.longValue() * 10;
        andou += metros;
        Long distanciaTotal = trecho.getDistancia();
        
        Ponto pontoA = trecho.getPontoA();
        Double latA = pontoA.getLatitude();
        Double lngA = pontoA.getLongitude();
        Ponto pontoB = trecho.getPontoB();
        Double latB = pontoB.getLatitude();
        Double lngB = pontoB.getLongitude();

        if (andou > distanciaTotal) {
            andou = distanciaTotal;

            lat = pontoB.getLatitude();
            lng = pontoB.getLongitude();
        } else {
            Double frac = andou.doubleValue() / distanciaTotal.doubleValue();

            Double deltaLat = Math.abs((latA - latB)*frac);
            Double deltaLng = Math.abs((lngA - lngB)*frac);

            if (latA > latB) {
                lat = latA - deltaLat;
            } else {
                lat = latA + deltaLat;
            }
            if (lngA > lngB) {
                lng = lngA - deltaLng;
            } else {
                lng = lngA + deltaLng;
            }
        }
        

        Boolean chegou = this.sendPostRequest(lat, lng, andou, velocidade, Calendar.getInstance().getTime().getTime());

        this.steps++;
        System.out.println("Passo: " + this.steps);
        if (chegou) {
            System.out.println("#####################");
            System.out.println("Chegou");
            System.out.println("#####################");

            andou = 0L;
            int index = (this.linhaEmSimulacao.getTrechos().indexOf(this.trecho) + 1) % this.linhaEmSimulacao.getTrechos().size();
            this.trecho = this.linhaEmSimulacao.getTrechos().get(index);


            // Criar entradas na tabela pra cálculo do erro.
            System.out.println("Tempo estimado: " + tempoEstimado);
            System.out.println("Tempo real: " + this.tempoReal);
            if (this.tempoEstimado != null) {
                Long real = (Calendar.getInstance().getTimeInMillis() - this.tempoReal) / 1000;

                Estimativa est = new Estimativa();
                est.setTempoEstimado(tempoEstimado);
                est.setTempoReal(real);
                est.setErro(Math.abs(real-tempoEstimado));
                this.em.getTransaction().begin();
                this.em.persist(est);
                this.em.getTransaction().commit();
            }

            this.steps = 0L;
            Trecho trechoEstimativa = this.linhaEmSimulacao.getTrechos().get(index);
            String estimado = estimativa.buscaTempoEstimadoAtePonto(this.linhaEmSimulacao.getId(), trechoEstimativa.getPontoB().getId());
            this.tempoEstimado = this.estimativaToSegundos(estimado);
            this.tempoReal = Calendar.getInstance().getTimeInMillis();

        }

        this.atualizaTrechoAtual(velocidade / 0.277777778);
    }

    private Long estimativaToSegundos(String tempo) {
        Long estimado;
        if (tempo.contains("Minutos")) {
            String t = tempo.replace(" Segundos", "").replace(" Minutos", "");
            String[] te = t.split(" ");
            if (te.length != 2) {
                throw new RuntimeException("Erro");
            }
            estimado = Long.parseLong(te[0])*60 + Long.parseLong(te[1]);
        } else {
            String t = tempo.replace(" Segundos", "");
            estimado = Long.parseLong(t);
        }

        return estimado;
    }

    private void atualizaTrechoAtual(Double velocidade) {
        TrechoAtual trechoAtual = estimativa.buscaTrechoAtualPorOnibusId(onibusId);

        this.jLabel10.setText(velocidade.toString());

        this.jTextField1.setText(trechoAtual.getLatitude().toString());
        this.jTextField2.setText(trechoAtual.getLongitude().toString());

        this.jLabel2.setText(trechoAtual.getTrecho().getPontoA().getNome());
        this.jLabel3.setText(trechoAtual.getTrecho().getPontoB().getNome());

        Long distancia = trechoAtual.getTrecho().getDistancia();
        Long percorrida = trechoAtual.getDistanciaPercorrida();
        Long porc = Math.round((percorrida.doubleValue() / distancia.doubleValue())*100);

        this.jProgressBar1.setValue(porc.intValue());

        this.jTextPane1.setText("10");
    }

    private Boolean sendPostRequest(Double lat, Double lng, Long distancia, Double velocidade, Long time) {

        //Build parameter string
        String data = "id=" + this.onibusId + "&lat=" + lat + "&lng=" + lng + "&d=" + distancia + "&v=" +
                velocidade + "&h=" + time;
        System.out.println("Dados enviados: " + data);
        try {

            // Send the request
            URL url = new URL(URL);
            URLConnection conn = url.openConnection();
            conn.setDoOutput(true);
            OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());

            //write parameters
            writer.write(data);
            writer.flush();

            // Get the response
            BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
            String s = reader.readLine();
            StringBuilder sb = new StringBuilder();
            while (s != null) {
                sb.append(s);
                s = reader.readLine();
            }
            writer.close();
            reader.close();

            return Boolean.parseBoolean(sb.toString());
        } catch (MalformedURLException ex) {
            ex.printStackTrace();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
        return null;
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JProgressBar jProgressBar1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSpinner jSpinner1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextPane jTextPane1;
    // End of variables declaration//GEN-END:variables

}
